const app = getApp();// pages/user/suoding.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getsuoding();
  },
  getsuoding: function () {
    var that = this;
    var FjLoginLog = wx.getStorageSync('FjLoginLog');
    var api_input = {
      UID: FjLoginLog.UID
    }
    app.getDaoPostN('api/FeijiuApp/Post_FJ_GetMySuoByUID', api_input, function (r) {
      if (r.code == 200) {
        var data = r.data.ds;
        for (var i = 0; i < data.length; i++) {
          data[i].FbDate = app.dateformatT(data[i].FbDate, 10)
        }
        that.setData({
          list: r.data.ds
        })
      }

    })
    // 
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  toInfo: function (e) {
    var that = this;
    var type = e.currentTarget.dataset.type;
    if (type == 1) {
      wx.navigateTo({
        url: '../gongqiuxinxi/detailed?gqid=' + e.currentTarget.dataset.gqid,
      })
    } else {
      wx.navigateTo({
        url: '/packageA/pages/zichanchuzhi/detailed?gqid=' + e.currentTarget.dataset.gqid,
      })
    }
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    this.getsuoding()
    this.onRefresh()
  },

  onRefresh: function () {
    //导航条加载动画
    wx.showNavigationBarLoading();
    setTimeout(function () {
      wx.hideNavigationBarLoading();
      //停止下拉刷新
      wx.stopPullDownRefresh();
    }, 2000);
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})